package com.yuyou.fn.platform.permission;

import java.io.Serializable;
import java.util.List;

/**
 * Created by wens on 2017/6/19.
 */
public class DataPermission implements Serializable{


    private List<Long> areaTeamIds ;

    private List<Long> busTeamIds ;

    private List<Long> campusIds ;

    private List<Long> gradeIds;

    private List<Long> subjectIds;


    /**
     * 0: 誉优 1:区域组 2:业务组
     */
    private Integer userType ;


    public DataPermission( Integer userType ,List<Long> areaTeamIds, List<Long> busTeamIds ,List<Long> campusIds ) {
        this.userType = userType ;
        this.areaTeamIds = areaTeamIds;
        this.busTeamIds = busTeamIds;
        this.campusIds = campusIds;
    }

    public List<Long> getCampusIds() {
        return campusIds;
    }

    public void setCampusIds(List<Long> campusIds) {
        this.campusIds = campusIds;
    }

    public List<Long> getAreaTeamIds() {
        return areaTeamIds;
    }

    public void setAreaTeamIds(List<Long> areaTeamIds) {
        this.areaTeamIds = areaTeamIds;
    }

    public List<Long> getBusTeamIds() {
        return busTeamIds;
    }

    public void setBusTeamIds(List<Long> busTeamIds) {
        this.busTeamIds = busTeamIds;
    }

    public boolean hasPermissionForBusTeam(Long busTeamId){
         return busTeamIds.contains(busTeamId);
    }

    public boolean hasPermissionForAreaTeam(Long areaTeamId){
        return areaTeamIds.contains(areaTeamId);
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public List<Long> getGradeIds() {
        return gradeIds;
    }

    public void setGradeIds(List<Long> gradeIds) {
        this.gradeIds = gradeIds;
    }

    public List<Long> getSubjectIds() {
        return subjectIds;
    }

    public void setSubjectIds(List<Long> subjectIds) {
        this.subjectIds = subjectIds;
    }
}
